examples: use G_DECLARE_FINAL_TYPE in applications
authorMohammed Sadiq <sadiq@sadiqpk.org>
Tue, 6 Sep 2016 17:56:22 +0000 (23:26 +0530)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 10 Sep 2016 13:01:08 +0000 (09:01 -0400)
G_DECLARE_FINAL_TYPE was introduced in glib 2.44.
We shall use that now so that lots of boilerplate code can
be reduced.

https://bugzilla.gnome.org/show_bug.cgi?id=770278

50 files changed:
examples/application1/exampleapp.c
examples/application1/exampleapp.h
examples/application1/exampleappwin.c
examples/application1/exampleappwin.h
examples/application10/exampleapp.c
examples/application10/exampleapp.h
examples/application10/exampleappprefs.c
examples/application10/exampleappprefs.h
examples/application10/exampleappwin.c
examples/application10/exampleappwin.h
examples/application2/exampleapp.c
examples/application2/exampleapp.h
examples/application2/exampleappwin.c
examples/application2/exampleappwin.h
examples/application3/exampleapp.c
examples/application3/exampleapp.h
examples/application3/exampleappwin.c
examples/application3/exampleappwin.h
examples/application4/exampleapp.c
examples/application4/exampleapp.h
examples/application4/exampleappwin.c
examples/application4/exampleappwin.h
examples/application5/exampleapp.c
examples/application5/exampleapp.h
examples/application5/exampleappwin.c
examples/application5/exampleappwin.h
examples/application6/exampleapp.c
examples/application6/exampleapp.h
examples/application6/exampleappprefs.c
examples/application6/exampleappprefs.h
examples/application6/exampleappwin.c
examples/application6/exampleappwin.h
examples/application7/exampleapp.c
examples/application7/exampleapp.h
examples/application7/exampleappprefs.c
examples/application7/exampleappprefs.h
examples/application7/exampleappwin.c
examples/application7/exampleappwin.h
examples/application8/exampleapp.c
examples/application8/exampleapp.h
examples/application8/exampleappprefs.c
examples/application8/exampleappprefs.h
examples/application8/exampleappwin.c
examples/application8/exampleappwin.h
examples/application9/exampleapp.c
examples/application9/exampleapp.h
examples/application9/exampleappprefs.c
examples/application9/exampleappprefs.h
examples/application9/exampleappwin.c
examples/application9/exampleappwin.h

index 6c4c5ed3cce6b65a232480a7f6970609cb1adbe1..565bc35c75cb23e8abf6fdcd8cacce70ea02fcf2 100644 (file)
@@ -8,11 +8,6 @@ struct _ExampleApp
   GtkApplication parent;
 };
 
-struct _ExampleAppClass
-{
-  GtkApplicationClass parent_class;
-};
-
 G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
 
 static void
index 824049d6991402b4b72456990967c4f26af37722..f7b837fbd5950659873567464704b5386df4064a 100644 (file)
@@ -5,14 +5,8 @@
 
 
 #define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
 
-
-typedef struct _ExampleApp       ExampleApp;
-typedef struct _ExampleAppClass  ExampleAppClass;
-
-
-GType           example_app_get_type    (void);
 ExampleApp     *example_app_new         (void);
 
 
index a4e9733e34beeedf11a24e0174fd27e23a6bd4f8..24dd05dd9f5911a478ff4876790a0940aec38bc5 100644 (file)
@@ -8,11 +8,6 @@ struct _ExampleAppWindow
   GtkApplicationWindow parent;
 };
 
-struct _ExampleAppWindowClass
-{
-  GtkApplicationWindowClass parent_class;
-};
-
 G_DEFINE_TYPE(ExampleAppWindow, example_app_window, GTK_TYPE_APPLICATION_WINDOW);
 
 static void
index ed4b34fcf5d6c57e433ebba573f02c91472aa8c0..786338d083f5c8f70742632655348838017b98a4 100644 (file)
@@ -6,14 +6,9 @@
 
 
 #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
 
 
-typedef struct _ExampleAppWindow         ExampleAppWindow;
-typedef struct _ExampleAppWindowClass    ExampleAppWindowClass;
-
-
-GType                   example_app_window_get_type     (void);
 ExampleAppWindow       *example_app_window_new          (ExampleApp *app);
 void                    example_app_window_open         (ExampleAppWindow *win,
                                                          GFile            *file);
index 66e85793f8c39cdf16acc009e009146b2df07b8d..64a3ceb1005b3449874b0e8175ab402e7f65ba56 100644 (file)
@@ -9,11 +9,6 @@ struct _ExampleApp
   GtkApplication parent;
 };
 
-struct _ExampleAppClass
-{
-  GtkApplicationClass parent_class;
-};
-
 G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
 
 static void
index 824049d6991402b4b72456990967c4f26af37722..51093791a3853073d38187adf01ebacb305b93bc 100644 (file)
@@ -5,14 +5,9 @@
 
 
 #define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
 
 
-typedef struct _ExampleApp       ExampleApp;
-typedef struct _ExampleAppClass  ExampleAppClass;
-
-
-GType           example_app_get_type    (void);
 ExampleApp     *example_app_new         (void);
 
 
index 6a033817bd8ff5132f78e6d9e9868c8556e16ba1..9b3cc33586ef8d0c295766b41539b036a5b2ca1a 100644 (file)
@@ -9,11 +9,6 @@ struct _ExampleAppPrefs
   GtkDialog parent;
 };
 
-struct _ExampleAppPrefsClass
-{
-  GtkDialogClass parent_class;
-};
-
 typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate;
 
 struct _ExampleAppPrefsPrivate
index c684889adf93ef7239802f72c1d4aa2bf7241789..2f08819ffb3c5e9ba0068f6db80fb45e2c535d2d 100644 (file)
@@ -6,14 +6,9 @@
 
 
 #define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ())
-#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs))
+G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog)
 
 
-typedef struct _ExampleAppPrefs          ExampleAppPrefs;
-typedef struct _ExampleAppPrefsClass     ExampleAppPrefsClass;
-
-
-GType                   example_app_prefs_get_type     (void);
 ExampleAppPrefs        *example_app_prefs_new          (ExampleAppWindow *win);
 
 
index 7ac1649a08483e77216e34811105645722819e37..294650f671608c2bba57cae328f85d52abf1de23 100644 (file)
@@ -8,11 +8,6 @@ struct _ExampleAppWindow
   GtkApplicationWindow parent;
 };
 
-struct _ExampleAppWindowClass
-{
-  GtkApplicationWindowClass parent_class;
-};
-
 typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate;
 
 struct _ExampleAppWindowPrivate
index ed4b34fcf5d6c57e433ebba573f02c91472aa8c0..88de502f889ee01af6a7e268894b701fee8b2db2 100644 (file)
@@ -6,14 +6,8 @@
 
 
 #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
 
-
-typedef struct _ExampleAppWindow         ExampleAppWindow;
-typedef struct _ExampleAppWindowClass    ExampleAppWindowClass;
-
-
-GType                   example_app_window_get_type     (void);
 ExampleAppWindow       *example_app_window_new          (ExampleApp *app);
 void                    example_app_window_open         (ExampleAppWindow *win,
                                                          GFile            *file);
index 6c4c5ed3cce6b65a232480a7f6970609cb1adbe1..565bc35c75cb23e8abf6fdcd8cacce70ea02fcf2 100644 (file)
@@ -8,11 +8,6 @@ struct _ExampleApp
   GtkApplication parent;
 };
 
-struct _ExampleAppClass
-{
-  GtkApplicationClass parent_class;
-};
-
 G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
 
 static void
index 824049d6991402b4b72456990967c4f26af37722..51093791a3853073d38187adf01ebacb305b93bc 100644 (file)
@@ -5,14 +5,9 @@
 
 
 #define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
 
 
-typedef struct _ExampleApp       ExampleApp;
-typedef struct _ExampleAppClass  ExampleAppClass;
-
-
-GType           example_app_get_type    (void);
 ExampleApp     *example_app_new         (void);
 
 
index 8098225f682c35ae4af7376abe23c5cfa42fb5d6..46c43ef85e1664e39aa8fd33a57c268b16af591c 100644 (file)
@@ -8,11 +8,6 @@ struct _ExampleAppWindow
   GtkApplicationWindow parent;
 };
 
-struct _ExampleAppWindowClass
-{
-  GtkApplicationWindowClass parent_class;
-};
-
 G_DEFINE_TYPE(ExampleAppWindow, example_app_window, GTK_TYPE_APPLICATION_WINDOW);
 
 static void
index ed4b34fcf5d6c57e433ebba573f02c91472aa8c0..786338d083f5c8f70742632655348838017b98a4 100644 (file)
@@ -6,14 +6,9 @@
 
 
 #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
 
 
-typedef struct _ExampleAppWindow         ExampleAppWindow;
-typedef struct _ExampleAppWindowClass    ExampleAppWindowClass;
-
-
-GType                   example_app_window_get_type     (void);
 ExampleAppWindow       *example_app_window_new          (ExampleApp *app);
 void                    example_app_window_open         (ExampleAppWindow *win,
                                                          GFile            *file);
index 6c4c5ed3cce6b65a232480a7f6970609cb1adbe1..565bc35c75cb23e8abf6fdcd8cacce70ea02fcf2 100644 (file)
@@ -8,11 +8,6 @@ struct _ExampleApp
   GtkApplication parent;
 };
 
-struct _ExampleAppClass
-{
-  GtkApplicationClass parent_class;
-};
-
 G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
 
 static void
index 824049d6991402b4b72456990967c4f26af37722..51093791a3853073d38187adf01ebacb305b93bc 100644 (file)
@@ -5,14 +5,9 @@
 
 
 #define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
 
 
-typedef struct _ExampleApp       ExampleApp;
-typedef struct _ExampleAppClass  ExampleAppClass;
-
-
-GType           example_app_get_type    (void);
 ExampleApp     *example_app_new         (void);
 
 
index 96475a75911ba1840ff31638f09afaf7ab5e1446..4cbdf2bf3258b5f13e1e6fd1569b63fff0e0cc3d 100644 (file)
@@ -8,11 +8,6 @@ struct _ExampleAppWindow
   GtkApplicationWindow parent;
 };
 
-struct _ExampleAppWindowClass
-{
-  GtkApplicationWindowClass parent_class;
-};
-
 typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate;
 
 struct _ExampleAppWindowPrivate
index ed4b34fcf5d6c57e433ebba573f02c91472aa8c0..786338d083f5c8f70742632655348838017b98a4 100644 (file)
@@ -6,14 +6,9 @@
 
 
 #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
 
 
-typedef struct _ExampleAppWindow         ExampleAppWindow;
-typedef struct _ExampleAppWindowClass    ExampleAppWindowClass;
-
-
-GType                   example_app_window_get_type     (void);
 ExampleAppWindow       *example_app_window_new          (ExampleApp *app);
 void                    example_app_window_open         (ExampleAppWindow *win,
                                                          GFile            *file);
index e83f139c263c96a1bf809ec1c61eb4fd04d45447..0f01fb388a6c8cec495dbf9be2bd08075304d494 100644 (file)
@@ -8,11 +8,6 @@ struct _ExampleApp
   GtkApplication parent;
 };
 
-struct _ExampleAppClass
-{
-  GtkApplicationClass parent_class;
-};
-
 G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
 
 static void
index 824049d6991402b4b72456990967c4f26af37722..51093791a3853073d38187adf01ebacb305b93bc 100644 (file)
@@ -5,14 +5,9 @@
 
 
 #define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
 
 
-typedef struct _ExampleApp       ExampleApp;
-typedef struct _ExampleAppClass  ExampleAppClass;
-
-
-GType           example_app_get_type    (void);
 ExampleApp     *example_app_new         (void);
 
 
index 96475a75911ba1840ff31638f09afaf7ab5e1446..4cbdf2bf3258b5f13e1e6fd1569b63fff0e0cc3d 100644 (file)
@@ -8,11 +8,6 @@ struct _ExampleAppWindow
   GtkApplicationWindow parent;
 };
 
-struct _ExampleAppWindowClass
-{
-  GtkApplicationWindowClass parent_class;
-};
-
 typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate;
 
 struct _ExampleAppWindowPrivate
index ed4b34fcf5d6c57e433ebba573f02c91472aa8c0..786338d083f5c8f70742632655348838017b98a4 100644 (file)
@@ -6,14 +6,9 @@
 
 
 #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
 
 
-typedef struct _ExampleAppWindow         ExampleAppWindow;
-typedef struct _ExampleAppWindowClass    ExampleAppWindowClass;
-
-
-GType                   example_app_window_get_type     (void);
 ExampleAppWindow       *example_app_window_new          (ExampleApp *app);
 void                    example_app_window_open         (ExampleAppWindow *win,
                                                          GFile            *file);
index e83f139c263c96a1bf809ec1c61eb4fd04d45447..0f01fb388a6c8cec495dbf9be2bd08075304d494 100644 (file)
@@ -8,11 +8,6 @@ struct _ExampleApp
   GtkApplication parent;
 };
 
-struct _ExampleAppClass
-{
-  GtkApplicationClass parent_class;
-};
-
 G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
 
 static void
index 824049d6991402b4b72456990967c4f26af37722..51093791a3853073d38187adf01ebacb305b93bc 100644 (file)
@@ -5,14 +5,9 @@
 
 
 #define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
 
 
-typedef struct _ExampleApp       ExampleApp;
-typedef struct _ExampleAppClass  ExampleAppClass;
-
-
-GType           example_app_get_type    (void);
 ExampleApp     *example_app_new         (void);
 
 
index 829afb98e0c8c76449fa09e26d111519e3168bbe..d716f2a1cf1f6e0de0c4b2c762d6fa6cf2ff9f56 100644 (file)
@@ -8,11 +8,6 @@ struct _ExampleAppWindow
   GtkApplicationWindow parent;
 };
 
-struct _ExampleAppWindowClass
-{
-  GtkApplicationWindowClass parent_class;
-};
-
 typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate;
 
 struct _ExampleAppWindowPrivate
index ed4b34fcf5d6c57e433ebba573f02c91472aa8c0..786338d083f5c8f70742632655348838017b98a4 100644 (file)
@@ -6,14 +6,9 @@
 
 
 #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
 
 
-typedef struct _ExampleAppWindow         ExampleAppWindow;
-typedef struct _ExampleAppWindowClass    ExampleAppWindowClass;
-
-
-GType                   example_app_window_get_type     (void);
 ExampleAppWindow       *example_app_window_new          (ExampleApp *app);
 void                    example_app_window_open         (ExampleAppWindow *win,
                                                          GFile            *file);
index d0e07744535a2ff8d16defcc4d8c2063f9a82e49..64a3ceb1005b3449874b0e8175ab402e7f65ba56 100644 (file)
@@ -4,16 +4,11 @@
 #include "exampleappwin.h"
 #include "exampleappprefs.h"
 
-struct ExampleApp
+struct _ExampleApp
 {
   GtkApplication parent;
 };
 
-struct ExampleAppClass
-{
-  GtkApplicationClass parent_class;
-};
-
 G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
 
 static void
index 8b51c598eab21bd6837cfb7ac07b0cff6731a4cd..51093791a3853073d38187adf01ebacb305b93bc 100644 (file)
@@ -5,14 +5,9 @@
 
 
 #define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
 
 
-typedef struct ExampleApp       ExampleApp;
-typedef struct ExampleAppClass  ExampleAppClass;
-
-
-GType           example_app_get_type    (void);
 ExampleApp     *example_app_new         (void);
 
 
index 6a033817bd8ff5132f78e6d9e9868c8556e16ba1..9b3cc33586ef8d0c295766b41539b036a5b2ca1a 100644 (file)
@@ -9,11 +9,6 @@ struct _ExampleAppPrefs
   GtkDialog parent;
 };
 
-struct _ExampleAppPrefsClass
-{
-  GtkDialogClass parent_class;
-};
-
 typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate;
 
 struct _ExampleAppPrefsPrivate
index c684889adf93ef7239802f72c1d4aa2bf7241789..2f08819ffb3c5e9ba0068f6db80fb45e2c535d2d 100644 (file)
@@ -6,14 +6,9 @@
 
 
 #define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ())
-#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs))
+G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog)
 
 
-typedef struct _ExampleAppPrefs          ExampleAppPrefs;
-typedef struct _ExampleAppPrefsClass     ExampleAppPrefsClass;
-
-
-GType                   example_app_prefs_get_type     (void);
 ExampleAppPrefs        *example_app_prefs_new          (ExampleAppWindow *win);
 
 
index 103dac5d31a9f9c78b41ceb58c0de00d5660ddaa..45e7de44a2a2947f4daf56be0114dffa80524fef 100644 (file)
@@ -3,16 +3,11 @@
 #include "exampleapp.h"
 #include "exampleappwin.h"
 
-struct ExampleAppWindow
+struct _ExampleAppWindow
 {
   GtkApplicationWindow parent;
 };
 
-struct ExampleAppWindowClass
-{
-  GtkApplicationWindowClass parent_class;
-};
-
 typedef struct ExampleAppWindowPrivate ExampleAppWindowPrivate;
 
 struct ExampleAppWindowPrivate
index 11ff3c27a7659f3e919c51d6285fc9b08e280e4d..786338d083f5c8f70742632655348838017b98a4 100644 (file)
@@ -6,14 +6,9 @@
 
 
 #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
 
 
-typedef struct ExampleAppWindow         ExampleAppWindow;
-typedef struct ExampleAppWindowClass    ExampleAppWindowClass;
-
-
-GType                   example_app_window_get_type     (void);
 ExampleAppWindow       *example_app_window_new          (ExampleApp *app);
 void                    example_app_window_open         (ExampleAppWindow *win,
                                                          GFile            *file);
index 66e85793f8c39cdf16acc009e009146b2df07b8d..64a3ceb1005b3449874b0e8175ab402e7f65ba56 100644 (file)
@@ -9,11 +9,6 @@ struct _ExampleApp
   GtkApplication parent;
 };
 
-struct _ExampleAppClass
-{
-  GtkApplicationClass parent_class;
-};
-
 G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
 
 static void
index 824049d6991402b4b72456990967c4f26af37722..51093791a3853073d38187adf01ebacb305b93bc 100644 (file)
@@ -5,14 +5,9 @@
 
 
 #define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
 
 
-typedef struct _ExampleApp       ExampleApp;
-typedef struct _ExampleAppClass  ExampleAppClass;
-
-
-GType           example_app_get_type    (void);
 ExampleApp     *example_app_new         (void);
 
 
index 6a033817bd8ff5132f78e6d9e9868c8556e16ba1..9b3cc33586ef8d0c295766b41539b036a5b2ca1a 100644 (file)
@@ -9,11 +9,6 @@ struct _ExampleAppPrefs
   GtkDialog parent;
 };
 
-struct _ExampleAppPrefsClass
-{
-  GtkDialogClass parent_class;
-};
-
 typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate;
 
 struct _ExampleAppPrefsPrivate
index c684889adf93ef7239802f72c1d4aa2bf7241789..2f08819ffb3c5e9ba0068f6db80fb45e2c535d2d 100644 (file)
@@ -6,14 +6,9 @@
 
 
 #define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ())
-#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs))
+G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog)
 
 
-typedef struct _ExampleAppPrefs          ExampleAppPrefs;
-typedef struct _ExampleAppPrefsClass     ExampleAppPrefsClass;
-
-
-GType                   example_app_prefs_get_type     (void);
 ExampleAppPrefs        *example_app_prefs_new          (ExampleAppWindow *win);
 
 
index 88ad7bcdf87a1110ae4874c4cada255b679b1ba2..2980393bf59bd5ac6814b5ab59549b6308f63d6b 100644 (file)
@@ -8,11 +8,6 @@ struct _ExampleAppWindow
   GtkApplicationWindow parent;
 };
 
-struct _ExampleAppWindowClass
-{
-  GtkApplicationWindowClass parent_class;
-};
-
 typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate;
 
 struct _ExampleAppWindowPrivate
index ed4b34fcf5d6c57e433ebba573f02c91472aa8c0..786338d083f5c8f70742632655348838017b98a4 100644 (file)
@@ -6,14 +6,9 @@
 
 
 #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
 
 
-typedef struct _ExampleAppWindow         ExampleAppWindow;
-typedef struct _ExampleAppWindowClass    ExampleAppWindowClass;
-
-
-GType                   example_app_window_get_type     (void);
 ExampleAppWindow       *example_app_window_new          (ExampleApp *app);
 void                    example_app_window_open         (ExampleAppWindow *win,
                                                          GFile            *file);
index 66e85793f8c39cdf16acc009e009146b2df07b8d..64a3ceb1005b3449874b0e8175ab402e7f65ba56 100644 (file)
@@ -9,11 +9,6 @@ struct _ExampleApp
   GtkApplication parent;
 };
 
-struct _ExampleAppClass
-{
-  GtkApplicationClass parent_class;
-};
-
 G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
 
 static void
index 824049d6991402b4b72456990967c4f26af37722..51093791a3853073d38187adf01ebacb305b93bc 100644 (file)
@@ -5,14 +5,9 @@
 
 
 #define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
 
 
-typedef struct _ExampleApp       ExampleApp;
-typedef struct _ExampleAppClass  ExampleAppClass;
-
-
-GType           example_app_get_type    (void);
 ExampleApp     *example_app_new         (void);
 
 
index 6a033817bd8ff5132f78e6d9e9868c8556e16ba1..9b3cc33586ef8d0c295766b41539b036a5b2ca1a 100644 (file)
@@ -9,11 +9,6 @@ struct _ExampleAppPrefs
   GtkDialog parent;
 };
 
-struct _ExampleAppPrefsClass
-{
-  GtkDialogClass parent_class;
-};
-
 typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate;
 
 struct _ExampleAppPrefsPrivate
index c684889adf93ef7239802f72c1d4aa2bf7241789..2f08819ffb3c5e9ba0068f6db80fb45e2c535d2d 100644 (file)
@@ -6,14 +6,9 @@
 
 
 #define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ())
-#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs))
+G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog)
 
 
-typedef struct _ExampleAppPrefs          ExampleAppPrefs;
-typedef struct _ExampleAppPrefsClass     ExampleAppPrefsClass;
-
-
-GType                   example_app_prefs_get_type     (void);
 ExampleAppPrefs        *example_app_prefs_new          (ExampleAppWindow *win);
 
 
index f85051968f1a01a16ee817abd952bc4b2bfa1a4a..3570d452d7a614c1d5fba82cf12010e66b0df419 100644 (file)
@@ -8,11 +8,6 @@ struct _ExampleAppWindow
   GtkApplicationWindow parent;
 };
 
-struct _ExampleAppWindowClass
-{
-  GtkApplicationWindowClass parent_class;
-};
-
 typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate;
 
 struct _ExampleAppWindowPrivate
index ed4b34fcf5d6c57e433ebba573f02c91472aa8c0..786338d083f5c8f70742632655348838017b98a4 100644 (file)
@@ -6,14 +6,9 @@
 
 
 #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
 
 
-typedef struct _ExampleAppWindow         ExampleAppWindow;
-typedef struct _ExampleAppWindowClass    ExampleAppWindowClass;
-
-
-GType                   example_app_window_get_type     (void);
 ExampleAppWindow       *example_app_window_new          (ExampleApp *app);
 void                    example_app_window_open         (ExampleAppWindow *win,
                                                          GFile            *file);
index 66e85793f8c39cdf16acc009e009146b2df07b8d..64a3ceb1005b3449874b0e8175ab402e7f65ba56 100644 (file)
@@ -9,11 +9,6 @@ struct _ExampleApp
   GtkApplication parent;
 };
 
-struct _ExampleAppClass
-{
-  GtkApplicationClass parent_class;
-};
-
 G_DEFINE_TYPE(ExampleApp, example_app, GTK_TYPE_APPLICATION);
 
 static void
index 824049d6991402b4b72456990967c4f26af37722..51093791a3853073d38187adf01ebacb305b93bc 100644 (file)
@@ -5,14 +5,9 @@
 
 
 #define EXAMPLE_APP_TYPE (example_app_get_type ())
-#define EXAMPLE_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_TYPE, ExampleApp))
+G_DECLARE_FINAL_TYPE (ExampleApp, example_app, EXAMPLE, APP, GtkApplication)
 
 
-typedef struct _ExampleApp       ExampleApp;
-typedef struct _ExampleAppClass  ExampleAppClass;
-
-
-GType           example_app_get_type    (void);
 ExampleApp     *example_app_new         (void);
 
 
index 6a033817bd8ff5132f78e6d9e9868c8556e16ba1..9b3cc33586ef8d0c295766b41539b036a5b2ca1a 100644 (file)
@@ -9,11 +9,6 @@ struct _ExampleAppPrefs
   GtkDialog parent;
 };
 
-struct _ExampleAppPrefsClass
-{
-  GtkDialogClass parent_class;
-};
-
 typedef struct _ExampleAppPrefsPrivate ExampleAppPrefsPrivate;
 
 struct _ExampleAppPrefsPrivate
index c684889adf93ef7239802f72c1d4aa2bf7241789..2f08819ffb3c5e9ba0068f6db80fb45e2c535d2d 100644 (file)
@@ -6,14 +6,9 @@
 
 
 #define EXAMPLE_APP_PREFS_TYPE (example_app_prefs_get_type ())
-#define EXAMPLE_APP_PREFS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_PREFS_TYPE, ExampleAppPrefs))
+G_DECLARE_FINAL_TYPE (ExampleAppPrefs, example_app_prefs, EXAMPLE, APP_PREFS, GtkDialog)
 
 
-typedef struct _ExampleAppPrefs          ExampleAppPrefs;
-typedef struct _ExampleAppPrefsClass     ExampleAppPrefsClass;
-
-
-GType                   example_app_prefs_get_type     (void);
 ExampleAppPrefs        *example_app_prefs_new          (ExampleAppWindow *win);
 
 
index d3103f97d301c36dec87033eb64ad6fff8e73ca6..15ceb1ef2811546ee561bb5200a41c6b9412a1a4 100644 (file)
@@ -8,11 +8,6 @@ struct _ExampleAppWindow
   GtkApplicationWindow parent;
 };
 
-struct _ExampleAppWindowClass
-{
-  GtkApplicationWindowClass parent_class;
-};
-
 typedef struct _ExampleAppWindowPrivate ExampleAppWindowPrivate;
 
 struct _ExampleAppWindowPrivate
index ed4b34fcf5d6c57e433ebba573f02c91472aa8c0..786338d083f5c8f70742632655348838017b98a4 100644 (file)
@@ -6,14 +6,9 @@
 
 
 #define EXAMPLE_APP_WINDOW_TYPE (example_app_window_get_type ())
-#define EXAMPLE_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_APP_WINDOW_TYPE, ExampleAppWindow))
+G_DECLARE_FINAL_TYPE (ExampleAppWindow, example_app_window, EXAMPLE, APP_WINDOW, GtkApplicationWindow)
 
 
-typedef struct _ExampleAppWindow         ExampleAppWindow;
-typedef struct _ExampleAppWindowClass    ExampleAppWindowClass;
-
-
-GType                   example_app_window_get_type     (void);
 ExampleAppWindow       *example_app_window_new          (ExampleApp *app);
 void                    example_app_window_open         (ExampleAppWindow *win,
                                                          GFile            *file);